package com.huaxin.device.models;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.huaxin.hxenum.enums.NotificationReadStatus;
import com.huaxin.hxenum.enums.NotificationSendStatus;
import com.huaxin.hxenum.enums.NotificationType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = true)
@TableName("device_alarm_notifications")
public class DeviceAlarmNotification extends BaseModel {

    @TableField(value = "device_alarm_id")
    @Schema(description = "设备报警ID", example = "d1001")
    private String deviceAlarmId;

    @TableField(value = "recipient_id")
    @Schema(description = "接收人ID", example = "e1001")
    private String recipientId;

    @TableField(value = "notification_type")
    @Schema(description = "通知方式：sms/app_push/email/in_system", example = "app_push")
    private NotificationType notificationType;

    @TableField(value = "content")
    @Schema(description = "通知内容", example = "您有一个新的维修工单待处理")
    private String content;

    @TableField(value = "send_status")
    @Schema(description = "发送状态：pending/sent/failed", example = "sent")
    private NotificationSendStatus sendStatus;

    @TableField(value = "read_status")
    @Schema(description = "阅读状态：unread/read", example = "unread")
    private NotificationReadStatus readStatus;

    @TableField(value = "send_time")
    @Schema(description = "发送时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime sendTime;

    @TableField(value = "family_id")
    @Schema(description = "家庭ID", example = "family_001")
    private String familyId;
}
